function getCookieValue(cookieName) {
    var cookieString = document.cookie;
    var cookies = cookieString.split("; ");
    for(var i = 0; i < cookies.length; i++) {
        var cookie = cookies[i].split("=");
        if(cookie[0] === cookieName) {
            return cookie[1];
        }
    }
    return null;
}